
export default class Buff extends Laya.Script {
    constructor() { super(); }

    onEnable(): void {
        let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody);
        rig.setVelocity({ x: 0, y: 6 })
    }

    onTriggerEnter(other): void {
        if(other.label === "cPlane"){
            this.owner.removeSelf();
        }
    }

    onDisable(): void {
        Laya.Pool.recover('buff', this.owner)
    }
}